package com.xuebank.nfe.nfecar

import android.app.Application
import android.os.Build
import android.webkit.WebView
import com.shudu.library.location.service.LocationService
import com.wzn.libaray.utils.Logger
import com.wzn.libaray.utils.cache.SharedPreferencesUtil
import com.wzn.libaray.utils.toast.ToastHelper
import com.xuebank.nfe.nfecar.globals.Constants

/**
 * Created by admin Mr.WANG 2018/11/15.
 */

class MyApplication : Application(){
    private val TAG = javaClass.simpleName
    override fun onCreate() {
        super.onCreate()
        myApplicationContext = this

        init()
    }

    private fun init() {
        //        initMiPush();
        ToastHelper.init(this)
//        if ((!Constants.IS_RELEASE || Constants.getServiceModel() != Constants.ServiceHostConfig.SERVICE_ONLINE) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
//            WebView.setWebContentsDebuggingEnabled(true)
//        }
    }
    init {
        myApplicationContext = this
    }


    companion object {
        val IS_ENVIRONMENTAL = "IS_ENVIRONMENTAL"
        var APP_Environmental:Int = 5
        lateinit var myApplicationContext: MyApplication
    }

    fun IS_ENVIRONMENTAL() {
        Logger.d(TAG,"myApplication选择的环境是多少${SharedPreferencesUtil.getInstance(this).getInt(IS_ENVIRONMENTAL,0)}")
        APP_Environmental = SharedPreferencesUtil.getInstance(this).getInt(IS_ENVIRONMENTAL,0)
    }

}
